using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace SystemFunctionLib.Apis
{
    internal partial class WinApis
    {
        public const int MAXPNAMELEN = 32;
        public const int MIXER_LONG_NAME_CHARS = 64;
        public const int MIXER_SHORT_NAME_CHARS = 16;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="volume"></param>
        /// <returns></returns>
        [DllImport("winmm.dll", EntryPoint = "waveOutGetVolume")]
        public static extern long GetWaveOutVolume(long deviceId, ref long volume);

        /// <summary>
        /// Sets the wave out volume.
        /// </summary>
        /// <param name="deviceId">Use zero for default device.</param>
        /// <param name="volume">A <see cref="long"/> value ranging from 0x0000 to 0xFFFF. 
        /// The low-order 8 bits contains the left-channel volume settings, and the high-order 8 bits
        /// contains the right-channel volume settings.</param>
        /// <returns></returns>
        [DllImport("winmm.dll", EntryPoint = "waveOutSetVolume")]
        public static extern long SetWaveOutVolume(long deviceId, long volume);

        [DllImport("winmm.dll")]
        public static extern uint sndPlaySound(string lpszSoundName, Int64 uSndMode);

        public const long SND_SYNC = 0;
        public const long SND_ASYNC = 1;
        public const long SND_LOOP = 8;
        public const long SND_STOP = 4;

        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern uint mixerGetNumDevs();


        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerGetDevCaps(uint uMxId, ref MIXERCAPS pmxcaps, uint cbmxcaps);

        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerOpen(ref uint phmx, uint uMxId, uint dwCallback, uint dwInstance, ObjectFlag fdwOpen);
        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerClose(uint hmx);

        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerGetLineInfo(uint hmxobj, ref MIXERLINE pmxl, GetLineInfoFlag fdwInfo);

        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerGetLineControls(uint hmxobj, ref MIXERLINECONTROLS pmxlc, GetLineControlsFlag fdwControls);

        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerGetControlDetails(uint hmxobj, ref MIXERCONTROLDETAILS pmxcd, GetControlDetailsFlag fdwDetails);
        [DllImport("winmm.dll", CharSet = CharSet.Ansi)]
        public static extern MMSYSERR mixerSetControlDetails(uint hmxobj, ref MIXERCONTROLDETAILS pmxcd, SetControlDetailsFlag fdwDetails);

        public static string MMSYSERR_ToString(MMSYSERR ERR)
        {
            switch (ERR)
            {
                case MMSYSERR.NOERROR:
                    return "No error.";
                case MMSYSERR.BADDEVICEID:
                    return "Invalid device identifier.";
                case MMSYSERR.NOTENABLED:
                    return "The driver is not enabled.";
                case MMSYSERR.ALLOCATED:
                    return "Device is opened by the maximum number of clients.";
                case MMSYSERR.INVALHANDLE:
                    return "Invalid handle.";
                case MMSYSERR.NODRIVER:
                    return "No mixer device is available.";
                case MMSYSERR.NOMEM:
                    return "The system is unable to allocate resources.";
                case MMSYSERR.NOTSUPPORTED:
                    return "The ACM driver did not process the message..";
                case MMSYSERR.BADERRNUM:
                    return "The specified error number is out of range.";
                case MMSYSERR.INVALFLAG:
                    return "One or more flags are invalid.";
                case MMSYSERR.INVALPARAM:
                    return "One or more parameters are invalid.";
                case MMSYSERR.HANDLEBUSY:
                    return "Handle busy.";
                case MMSYSERR.INVALIDALIAS:
                    return "Invalid Alias.";
                case MMSYSERR.READERROR:
                    return "Read error.";
                case MMSYSERR.WRITEERROR:
                    return "Write error.";
                case MMSYSERR.DELETEERROR:
                    return "Delete error.";
                default:
                    return "Undifined error code.";
            }
        }

        public static string Mid_ToString(Mid wMid)
        {
            switch (wMid)
            {
                case Mid.MM_MICROSOFT:
                    return "Microsoft Corporation";
                case Mid.MM_CREATIVE:
                    return "Creative Labs, Inc.";
                case Mid.MM_MEDIAVISION:
                    return "Media Vision, Inc.";
                case Mid.MM_FUJITSU:
                    return "Fujitsu, Ltd.";
                case Mid.MM_ARTISOFT:
                    return "Artisoft, Inc.";
                case Mid.MM_TURTLE_BEACH:
                    return "Turtle Beach Systems";
                case Mid.MM_IBM:
                    return "International Business Machines";
                case Mid.MM_VOCALTEC:
                    return "VocalTec, Inc.";
                case Mid.MM_ROLAND:
                    return "Roland Corporation";
                case Mid.MM_DSP_SOLUTIONS:
                    return "DSP Solutions, Inc.";
                case Mid.MM_NEC:
                    return "NEC Corporation";
                case Mid.MM_ATI:
                    return "ATI Technologies, Inc.";
                case Mid.MM_WANGLABS:
                    return "Wang Laboratories";
                case Mid.MM_TANDY:
                    return "Tandy Corporation";
                case Mid.MM_VOYETRA:
                    return "Voyetra Technologies";
                case Mid.MM_ANTEX:
                    return "Antex Electronics Corporation";
                case Mid.MM_ICL_PS:
                    return "ICL Personal Systems";
                case Mid.MM_INTEL:
                    return "Intel Corporation";
                case Mid.MM_GRAVIS:
                    return "Advanced Gravis Computer Technology, Ltd.";
                case Mid.MM_VAL:
                    return "Video Associates Labs, Inc.";
                case Mid.MM_INTERACTIVE:
                    return "InterActive, Inc.";
                case Mid.MM_YAMAHA:
                    return "Yamaha Corporation of America";
                case Mid.MM_EVEREX:
                    return "Everex Systems, Inc.";
                case Mid.MM_ECHO:
                    return "Echo Speech Corporation";
                case Mid.MM_SIERRA:
                    return "Sierra Semiconductor Corporation";
                case Mid.MM_CAT:
                    return "Computer Aided Technology, Inc.";
                case Mid.MM_APPS:
                    return "APPS Software";
                case Mid.MM_DSP_GROUP:
                    return "DSP Group, Inc.";
                case Mid.MM_MELABS:
                    return "microEngineering Labs";
                case Mid.MM_COMPUTER_FRIENDS:
                    return "Computer Friends, Inc.";
                case Mid.MM_ESS:
                    return "ESS Technology, Inc.";
                case Mid.MM_AUDIOFILE:
                    return "Audio, Inc.";
                case Mid.MM_MOTOROLA:
                    return "Motorola, Inc.";
                case Mid.MM_CANOPUS:
                    return "Canopus, Co., Ltd.";
                case Mid.MM_EPSON:
                    return "Seiko Epson Corporation, Inc.";
                case Mid.MM_TRUEVISION:
                    return "Truevision, Inc.";
                case Mid.MM_AZTECH:
                    return "Aztech Labs, Inc.";
                case Mid.MM_VIDEOLOGIC:
                    return "VideoLogic, Inc.";
                case Mid.MM_SCALACS:
                    return "SCALACS";
                case Mid.MM_KORG:
                    return "Toshihiko Okuhura, Korg, Inc.";
                case Mid.MM_APT:
                    return "Audio Processing Technology";
                case Mid.MM_ICS:
                    return "Integrated Circuit Systems, Inc.";
                case Mid.MM_ITERATEDSYS:
                    return "Iterated Systems, Inc.";
                case Mid.MM_METHEUS:
                    return "Metheus Corporation";
                case Mid.MM_LOGITECH:
                    return "Logitech, Inc.";
                case Mid.MM_WINNOV:
                    return "Winnov, LP";
                case Mid.MM_NCR:
                    return "NCR Corporation";
                case Mid.MM_EXAN:
                    return "EXAN, Ltd.";
                case Mid.MM_AST:
                    return "AST Research, Inc.";
                case Mid.MM_WILLOWPOND:
                    return "Willow Pond Corporation";
                case Mid.MM_SONICFOUNDRY:
                    return "Sonic Foundry";
                case Mid.MM_VITEC:
                    return "Visual Information Technologies, Inc.";
                case Mid.MM_MOSCOM:
                    return "MOSCOM Corporation";
                case Mid.MM_SILICONSOFT:
                    return "Silicon Software, Inc.";
                case Mid.MM_SUPERMAC:
                    return "Supermac Technology, Inc.";
                case Mid.MM_AUDIOPT:
                    return "Audio Processing Technology";
                case Mid.MM_SPEECHCOMP:
                    return "Speech Compression";
                case Mid.MM_DOLBY:
                    return "Dolby Laboratories, Inc.";
                case Mid.MM_OKI:
                    return "OKI";
                case Mid.MM_AURAVISION:
                    return "Auravision Corporation";
                case Mid.MM_OLIVETTI:
                    return "Ing. C. Olivetti & C., S.p.A.";
                case Mid.MM_IOMAGIC:
                    return "I/O Magic Corporation";
                case Mid.MM_MATSUSHITA:
                    return "Matsushita Electric Corporation of America";
                case Mid.MM_CONTROLRES:
                    return "Control Resources Corporation";
                case Mid.MM_XEBEC:
                    return "Xebec Multimedia Solutions Limited";
                case Mid.MM_NEWMEDIA:
                    return "New Media Corporation";
                case Mid.MM_NMS:
                    return "Natural MicroSystems Corporation";
                case Mid.MM_LYRRUS:
                    return "Lyrrus, Inc.";
                case Mid.MM_COMPUSIC:
                    return "Compusic";
                case Mid.MM_OPTI:
                    return "OPTi, Inc.";
                case Mid.MM_DIALOGIC:
                    return "Dialogic Corporation";
                default:
                    return "Unknow";
            }
        }

    }

    internal enum MMSYSERR : uint
    {
        NOERROR = 0x0,
        ERROR = (NOERROR + 1),
        BADDEVICEID = (NOERROR + 2),
        NOTENABLED = (NOERROR + 3),
        ALLOCATED = (NOERROR + 4),
        INVALHANDLE = (NOERROR + 5),
        NODRIVER = (NOERROR + 6),
        NOMEM = (NOERROR + 7),
        NOTSUPPORTED = (NOERROR + 8),
        BADERRNUM = (NOERROR + 9),
        INVALFLAG = (NOERROR + 10),
        INVALPARAM = (NOERROR + 11),
        HANDLEBUSY = (NOERROR + 12),
        INVALIDALIAS = (NOERROR + 13),
        BADDB = (NOERROR + 14),
        KEYNOTFOUND = (NOERROR + 15),
        READERROR = (NOERROR + 16),
        WRITEERROR = (NOERROR + 17),
        DELETEERROR = (NOERROR + 18),
        VALNOTFOUND = (NOERROR + 19),
        NODRIVERCB = (NOERROR + 20)

    };

    internal enum Mid : short
    {
        MM_MICROSOFT = 1,
        MM_CREATIVE = 2,
        MM_MEDIAVISION = 3,
        MM_FUJITSU = 4,
        MM_ARTISOFT = 20,
        MM_TURTLE_BEACH = 21,
        MM_IBM = 22,
        MM_VOCALTEC = 23,
        MM_ROLAND = 24,
        MM_DSP_SOLUTIONS = 25,
        MM_NEC = 26,
        MM_ATI = 27,
        MM_WANGLABS = 28,
        MM_TANDY = 29,
        MM_VOYETRA = 30,
        MM_ANTEX = 31,
        MM_ICL_PS = 32,
        MM_INTEL = 33,
        MM_GRAVIS = 34,
        MM_VAL = 35,
        MM_INTERACTIVE = 36,
        MM_YAMAHA = 37,
        MM_EVEREX = 38,
        MM_ECHO = 39,
        MM_SIERRA = 40,
        MM_CAT = 41,
        MM_APPS = 42,
        MM_DSP_GROUP = 43,
        MM_MELABS = 44,
        MM_COMPUTER_FRIENDS = 45,
        MM_ESS = 46,
        MM_AUDIOFILE = 47,
        MM_MOTOROLA = 48,
        MM_CANOPUS = 49,
        MM_EPSON = 50,
        MM_TRUEVISION = 51,
        MM_AZTECH = 52,
        MM_VIDEOLOGIC = 53,
        MM_SCALACS = 54,
        MM_KORG = 55,
        MM_APT = 56,
        MM_ICS = 57,
        MM_ITERATEDSYS = 58,
        MM_METHEUS = 59,
        MM_LOGITECH = 60,
        MM_WINNOV = 61,
        MM_NCR = 62,
        MM_EXAN = 63,
        MM_AST = 64,
        MM_WILLOWPOND = 65,
        MM_SONICFOUNDRY = 66,
        MM_VITEC = 67,
        MM_MOSCOM = 68,
        MM_SILICONSOFT = 69,
        MM_SUPERMAC = 73,
        MM_AUDIOPT = 74,
        MM_SPEECHCOMP = 76,
        MM_DOLBY = 78,
        MM_OKI = 79,
        MM_AURAVISION = 80,
        MM_OLIVETTI = 81,
        MM_IOMAGIC = 82,
        MM_MATSUSHITA = 83,
        MM_CONTROLRES = 84,
        MM_XEBEC = 85,
        MM_NEWMEDIA = 86,
        MM_NMS = 87,
        MM_LYRRUS = 88,
        MM_COMPUSIC = 89,
        MM_OPTI = 90,
        MM_DIALOGIC = 93
    }

    internal enum GetLineInfoFlag : uint
    {
        DESTINATION = 0x0,
        SOURCE = 0x1,
        LINEID = 0x2,
        COMPONENTTYPE = 0x3,
        TARGETTYPE = 0x4,
        QUERYMASK = 0xF,
    }

    internal enum ObjectFlag : uint
    {
        MIXER = 0x00000000,
        WAVEOUT = 0x10000000,
        WAVEIN = 0x20000000,
        MIDIOUT = 0x30000000,
        MIDIIN = 0x40000000,
        AUX = 0x50000000,
        HANDLE = 0x80000000,
        HMIDIIN = (HANDLE | MIDIIN),
        HMIDIOUT = (HANDLE | MIDIOUT),
        HMIXER = (HANDLE | MIXER),
        HWAVEIN = (HANDLE | WAVEIN),
        HWAVEOUT = (HANDLE | WAVEOUT)
    }

    internal enum LineFlag : uint
    {
        ACTIVE = 0x00000001,
        DISCONNECTED = 0x00008000,
        SOURCE = 0x80000000,
    }

    public enum ComponentType : uint
    {
        DestUndefined = 0x0000, // DST_UNDEFINED

        DestDigital = (DestUndefined + 1), // DST_DIGITAL
        DestLine = (DestUndefined + 2), // DST_LINE
        DestMonitor = (DestUndefined + 3), // DST_MONITOR
        DestSpeakers = (DestUndefined + 4), // DST_SPEAKERS
        DestHeadphones = (DestUndefined + 5), // DST_HEADPHONES
        DestTelephone = (DestUndefined + 6), // DST_TELEPHONE
        DestWaveIn = (DestUndefined + 7), // DST_WAVEIN
        DestVoiceIn = (DestUndefined + 8), // DST_VOICEIN

        SrcUndefined = 0x1000, // SRC_UNDEFINED

        SrcDigital = (SrcUndefined + 1), // SRC_DIGITAL
        SrcLine = (SrcUndefined + 2), // SRC_LINE
        SrcMicrophone = (SrcUndefined + 3), // SRC_MICROPHONE
        SrcSWSynth = (SrcUndefined + 4), // SRC_SYNTHESIZER
        SrcCDPlayer = (SrcUndefined + 5), // SRC_COMPACTDISC
        SrcTelephone = (SrcUndefined + 6), // SRC_TELEPHONE
        SrcPCSpeaker = (SrcUndefined + 7), // SRC_PCSPEAKER
        SrcWaveOut = (SrcUndefined + 8), // SRC_WAVEOUT
        SrcAuxiliary = (SrcUndefined + 9), // SRC_AUXILIARY
        SrcAnalog = (SrcUndefined + 10), // SRC_ANALOG
    }

    internal enum TargetType : uint
    {
        UNDEFINED = 0x0,
        WAVEOUT = 0x1,
        WAVEIN = 0x2,
        MIDIOUT = 0x3,
        MIDIIN = 0x4,
        AUX = 0x5,
    }

    internal enum ControlType_Units : uint
    {
        CUSTOM = 0x000000,
        BOOLEAN = 0x010000,
        SIGNED = 0x020000,
        UNSIGNED = 0x030000,
        DECIBELS = 0x040000,
        PERCENT = 0x050000,
        MASK = 0xFF0000,
    }

    internal enum ControlType_SubClass : uint
    {
        LIST_SINGLE = 0x0000000,
        METER_POLLED = 0x0000000,
        SWITCH_BOOLEAN = 0x0000000,
        TIME_MICROSECS = 0x0000000,
        LIST_MULTIPLE = 0x1000000,
        SWITCH_BUTTON = 0x1000000,
        TIME_MILLISECS = 0x1000000,
        MASK = 0xF000000,
    }

    internal enum ControlType_Class : uint
    {
        CUSTOM = 0x00000000,
        METER = 0x10000000,
        SWITCH = 0x20000000,
        NUMBER = 0x30000000,
        SLIDER = 0x40000000,
        FADER = 0x50000000,
        TIME = 0x60000000,
        LIST = 0x70000000,
        MASK = 0xF0000000,
    }

    internal enum ControlType : uint
    {
        CUSTOM = (ControlType_Class.CUSTOM | ControlType_Units.CUSTOM),
        BOOLEANMETER = (ControlType_Class.METER | ControlType_SubClass.METER_POLLED | ControlType_Units.BOOLEAN),
        SIGNEDMETER = (ControlType_Class.METER | ControlType_SubClass.METER_POLLED | ControlType_Units.SIGNED),
        PEAKMETER = (SIGNEDMETER + 1),
        UNSIGNEDMETER = (ControlType_Class.METER | ControlType_SubClass.METER_POLLED | ControlType_Units.UNSIGNED),
        BUTTON = (ControlType_Class.SWITCH | ControlType_SubClass.SWITCH_BUTTON | ControlType_Units.BOOLEAN),
        BOOLEAN = (ControlType_Class.SWITCH | ControlType_SubClass.SWITCH_BOOLEAN | ControlType_Units.BOOLEAN),
        ONOFF = (BOOLEAN + 1),
        MUTE = (BOOLEAN + 2),
        MONO = (BOOLEAN + 3),
        LOUDNESS = (BOOLEAN + 4),
        STEREOENH = (BOOLEAN + 5),
        PERCENT = (ControlType_Class.NUMBER | ControlType_Units.PERCENT),
        SIGNED = (ControlType_Class.NUMBER | ControlType_Units.SIGNED),
        UNSIGNED = (ControlType_Class.NUMBER | ControlType_Units.UNSIGNED),
        DECIBELS = (ControlType_Class.NUMBER | ControlType_Units.DECIBELS),
        SLIDER = (ControlType_Class.SLIDER | ControlType_Units.SIGNED),
        PAN = (SLIDER + 1),
        QSOUNDPAN = (SLIDER + 2),
        FADER = (ControlType_Class.FADER | ControlType_Units.UNSIGNED),
        VOLUME = (FADER + 1),
        BASS = (FADER + 2),
        TREBLE = (FADER + 3),
        EQUALIZER = (FADER + 4),
        MICROTIME = (ControlType_Class.TIME | ControlType_SubClass.TIME_MICROSECS | ControlType_Units.UNSIGNED),
        MILLITIME = (ControlType_Class.TIME | ControlType_SubClass.TIME_MILLISECS | ControlType_Units.UNSIGNED),
        SINGLESELECT = (ControlType_Class.LIST | ControlType_SubClass.LIST_SINGLE | ControlType_Units.BOOLEAN),
        MUX = (SINGLESELECT + 1),
        MULTIPLESELECT = (ControlType_Class.LIST | ControlType_SubClass.LIST_MULTIPLE | ControlType_Units.BOOLEAN),
        MIXER = (MULTIPLESELECT + 1),
    }

    internal enum GetLineControlsFlag : uint
    {
        ALL = 0x0,
        ONEBYID = 0x1,
        ONEBYTYPE = 0x2,
        QUERYMASK = 0xF,
    }

    internal enum GetControlDetailsFlag : uint
    {
        VALUE = 0x0,
        LISTTEXT = 0x1,
        QUERYMASK = 0xF,
    }

    internal enum SetControlDetailsFlag : uint
    {
        VALUE = 0x0,
        CUSTOM = 0x1,
        QUERYMASK = 0xF,

    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCAPS
    {
        public Mid wMid;
        public short wPid;
        public int vDriverVersion;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MAXPNAMELEN)]
        public string szPname;
        public uint fdwSupport;
        public uint cDestinations;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERLINE
    {
        public uint cbStruct;
        public uint dwDestination;
        public uint dwSource;
        public uint dwLineID;
        public uint fdwLine;
        public uint dwUser;
        public ComponentType dwComponentType;
        public uint cChannels;
        public uint cConnections;
        public uint cControls;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MIXER_SHORT_NAME_CHARS)]
        public string szShortName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MIXER_LONG_NAME_CHARS)]
        public string szName;
        public TargetType dwType;
        public uint dwDeviceID;
        public Mid wMid;
        public short wPid;
        public uint vDriverVersion;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MAXPNAMELEN)]
        public string szPname;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERLINECONTROLS
    {
        public uint cbStruct;
        public uint dwLineID;

        public uint dwControl;
        public uint cControls;
        public uint cbmxctrl;
        public uint pamxctrl;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROL
    {
        public uint cbStruct;
        public uint dwControlID;
        public ControlType dwControlType;
        public uint fdwControl;
        public uint cMultipleItems;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MIXER_SHORT_NAME_CHARS)]
        public string szShortName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MIXER_LONG_NAME_CHARS)]
        public string szName;
        public uint dwMinimum;
        public uint dwMaximum;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
        public uint[] dwReserved;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROLDETAILS
    {
        public uint cbStruct;
        public uint dwControlID;
        public uint cChannels;
        public uint item;
        public uint cbDetails;
        public uint paDetails;
    }


    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROLDETAILS_LISTTEXT
    {
        public uint dwParam1;
        public uint dwParam2;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = WinApis.MIXER_LONG_NAME_CHARS)]
        public string szName;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROLDETAILS_UNSIGNED
    {
        public uint dwValue;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROLDETAILS_SIGNED
    {
        public long lValue;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    internal struct MIXERCONTROLDETAILS_BOOLEAN
    {
        public long fValue;
    }
}
